﻿CREATE TABLE [dbo].[SignInNotice]
(
	[Id] INT NOT NULL PRIMARY KEY IDENTITY,
	[WxUserId] BIGINT NULL,  
	[OrderNo] NVARCHAR(50) NULL,  
    [DeptName] NVARCHAR(50) NULL, 
    [DoctorName] NVARCHAR(50) NULL,
	[RegDate]  NVARCHAR(50) NULL,
	[StartTime]  NVARCHAR(10) NULL,
	[EndTime]  NVARCHAR(10) NULL,
	[Status] INT NOT NULL DEFAULT 0,     
	[CardNo] NVARCHAR(50) NULL, 
    [Name] NVARCHAR(50) NULL,     		 
	[PatientId] NVARCHAR(50) NULL,  
    [CreateTime] DATETIME NULL, 
    [UpdateTime] DATETIME NULL, 
    [SendUserCount] INT NULL DEFAULT 0, 
	[NeedSendTime] DATETIME NULL,
	[DeadlineToSend] DATETIME NULL,
    [IsSended] INT NULL, 
    [SendTime] DATETIME NULL
)

GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'订单号',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SignInNotice',
    @level2type = N'COLUMN',
    @level2name = N'OrderNo'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'科室',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SignInNotice',
    @level2type = N'COLUMN',
    @level2name = N'DeptName'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'医生',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SignInNotice',
    @level2type = N'COLUMN',
    @level2name = N'DoctorName'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'就诊日期',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SignInNotice',
    @level2type = N'COLUMN',
    @level2name = N'RegDate'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'开始时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SignInNotice',
    @level2type = N'COLUMN',
    @level2name = N'StartTime'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'结束时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SignInNotice',
    @level2type = N'COLUMN',
    @level2name = N'EndTime'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'标志列ID',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SignInNotice',
    @level2type = N'COLUMN',
    @level2name = N'Id'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'状态：0x00-未发送 0x1-完成，0x2-删除，0x4-锁定',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SignInNotice',
    @level2type = N'COLUMN',
    @level2name = N'Status'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'卡号',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SignInNotice',
    @level2type = N'COLUMN',
    @level2name = N'CardNo'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'患者姓名',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SignInNotice',
    @level2type = N'COLUMN',
    @level2name = N'Name'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'患者ID',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SignInNotice',
    @level2type = N'COLUMN',
    @level2name = N'PatientId'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'记录创建时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SignInNotice',
    @level2type = N'COLUMN',
    @level2name = N'CreateTime'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'记录更新时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SignInNotice',
    @level2type = N'COLUMN',
    @level2name = N'UpdateTime'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'需要发送用户数',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SignInNotice',
    @level2type = N'COLUMN',
    @level2name = N'SendUserCount'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'需要发送时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SignInNotice',
    @level2type = N'COLUMN',
    @level2name = N'NeedSendTime'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'是否已经发送 0-未发送 1-已发送 2-已报到，未发送,3 过了最后发送时间，未发送',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SignInNotice',
    @level2type = N'COLUMN',
    @level2name = N'IsSended'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'发送时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SignInNotice',
    @level2type = N'COLUMN',
    @level2name = N'SendTime'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'最晚发送时间，过时不发',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SignInNotice',
    @level2type = N'COLUMN',
    @level2name = N'DeadlineToSend'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'微信用户ID',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SignInNotice',
    @level2type = N'COLUMN',
    @level2name = N'WxUserId'